package com.example.javabasic.elasticsearch.booksearch;


import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;

/**
 * @description 常量
 * @Author Lin FuYuan
 * @date 2021/6/16
 */
public class Constants {
    public static final String ID = "id";
    public static final String TITLE = "title";
    public static final String AUTHORS = "authors";
    public static final String SUMMARY = "summary";
    public static final String PUBLISHDATE = "publishDate";
    public static final String PUBLISHER = "publisher";
    public static final String NUMREVIEWS = "numReviews";
    public static final String TITLE_KEYWORD = "title.keyword";
    public static final String PUBLISHER_KEYWORD = "publisher.keyword";
    /**
     *过滤要返回的字段
     */
    /**
     * id,概要,发布时间
     */
    public static String[] fetchFieldsTSPD = {ID, TITLE, SUMMARY, PUBLISHDATE};
    /**
     * id,标题,作者
     */
    public static String[] fetchFieldsTA = {ID, TITLE, AUTHORS};
    /**
     * id,概要,作者
     */
    public static String[] fetchFieldsSA = {ID, SUMMARY, AUTHORS};
    /**
     * id,标题,概要,作者
     */
    public static String[] fetchFieldsTSA = {ID, TITLE, SUMMARY, AUTHORS};
    /**
     * id,标题,发布人,发布时间
     */
    public static String[] fetchFieldsTPPD = {ID, TITLE, PUBLISHER, PUBLISHDATE};
    /**
     * id,标题,概要,发布人,评论数量
     */
    public static String[] fetchFieldsTSPN = {ID, TITLE, SUMMARY, PUBLISHER, NUMREVIEWS};
    /**
     * 高亮
     */
    public static HighlightBuilder highlightS = new HighlightBuilder().field(SUMMARY);


}
